
package associados.classes;

import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;

public class ConsultaHistoricoTableModel extends AbstractTableModel {

    private List<Historico> listaHistorico;
    private String[] colunas = {"Data","Descrição"};

    public ConsultaHistoricoTableModel(){
        listaHistorico= new ArrayList<Historico>();
    }

    public int getRowCount() {
        return listaHistorico.size();
    }

    public int getColumnCount() {
        return colunas.length;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
         Historico historico = listaHistorico.get(rowIndex);
        if (columnIndex == 0) {
            return historico.getDatahistorico() ;
        } else {
            return historico.getHistorico();
        }
    }

}
